Private Sub DrawBranch(ByVal bend As Single, ByVal thickness As Single, ByVal Depth As Integer, ByVal X As Single, ByVal Y As Single, ByVal length As Single, ByVal length_scale As Single, ByVal rnd_scale As Single, ByVal theta As Single, ByVal dtheta As Single, ByVal rnd_dtheta As Single, ByVal max_branches As Integer)
Const DIST_PER_BEND = 5#
Const BEND_FACTOR = 2#
Const MAX_BEND = PI / 6
Dim x1 As Integer
Dim y1 As Integer
Dim x2 As Integer
Dim y2 As Integer
Dim status As Integer
Dim num_bends As Integer
Dim num_branches As Integer
Dim i As Integer
Dim new_length As Integer
Dim new_theta As Single
Dim new_bend As Single
Dim dt As Single
Dim t As Single
If thickness > 0 Then picCanvas.DrawWidth = thickness